﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace MindASPCoreWebAPI.Repository.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "acth_db",
                columns: table => new
                {
                    auth_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    auth_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_acth_db", x => x.auth_id);
                });

            migrationBuilder.CreateTable(
                name: "actiarea_db",
                columns: table => new
                {
                    actiarea_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    actiarea_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_actiarea_db", x => x.actiarea_id);
                });

            migrationBuilder.CreateTable(
                name: "activityadmin_db",
                columns: table => new
                {
                    acti_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    acti_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    type_id = table.Column<int>(type: "int", nullable: false),
                    acti_time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    acti_site = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    acti_priname = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    acti_clientsum = table.Column<int>(type: "int", nullable: false),
                    acti_price = table.Column<double>(type: "float", nullable: false),
                    actiarea_id = table.Column<int>(type: "int", nullable: false),
                    com_ind_id = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_activityadmin_db", x => x.acti_id);
                });

            migrationBuilder.CreateTable(
                name: "area_db",
                columns: table => new
                {
                    area_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    area_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_area_db", x => x.area_id);
                });

            migrationBuilder.CreateTable(
                name: "companyadmin_db",
                columns: table => new
                {
                    com_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    com_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    com_ind_id = table.Column<int>(type: "int", nullable: false),
                    com_state = table.Column<bool>(type: "bit", nullable: false),
                    nat_id = table.Column<int>(type: "int", nullable: false),
                    com_ka_id = table.Column<int>(type: "int", nullable: false),
                    com_mp4 = table.Column<bool>(type: "bit", nullable: false),
                    com_ad = table.Column<bool>(type: "bit", nullable: false),
                    com_site = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    com_order = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_companyadmin_db", x => x.com_id);
                });

            migrationBuilder.CreateTable(
                name: "custadmin_db",
                columns: table => new
                {
                    cust_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cust_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_englishname = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_sex = table.Column<bool>(type: "bit", nullable: false),
                    com_id = table.Column<int>(type: "int", nullable: false),
                    area_id = table.Column<int>(type: "int", nullable: false),
                    cust_depa = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    posi_id = table.Column<int>(type: "int", nullable: false),
                    cust_deta = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    leve_id = table.Column<int>(type: "int", nullable: false),
                    auth_id = table.Column<int>(type: "int", nullable: false),
                    lang_id = table.Column<int>(type: "int", nullable: false),
                    lang_workphone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_birt = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cust_postal = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_market = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_hobby = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_desc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_wecha = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cust_create = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cust_modi = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cust_remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_custadmin_db", x => x.cust_id);
                });

            migrationBuilder.CreateTable(
                name: "industryadmin_db",
                columns: table => new
                {
                    com_ind_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    com_ind_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    com_ind_order = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_industryadmin_db", x => x.com_ind_id);
                });

            migrationBuilder.CreateTable(
                name: "ka_db",
                columns: table => new
                {
                    com_ka_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    com_ka_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ka_db", x => x.com_ka_id);
                });

            migrationBuilder.CreateTable(
                name: "lang_db",
                columns: table => new
                {
                    lang_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    lang_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_lang_db", x => x.lang_id);
                });

            migrationBuilder.CreateTable(
                name: "level_db",
                columns: table => new
                {
                    leve_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    leve_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_level_db", x => x.leve_id);
                });

            migrationBuilder.CreateTable(
                name: "nat_db",
                columns: table => new
                {
                    nat_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    nat_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_nat_db", x => x.nat_id);
                });

            migrationBuilder.CreateTable(
                name: "posi_db",
                columns: table => new
                {
                    posi_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    posi_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_posi_db", x => x.posi_id);
                });

            migrationBuilder.CreateTable(
                name: "type_db",
                columns: table => new
                {
                    type_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    type_name = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_type_db", x => x.type_id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "acth_db");

            migrationBuilder.DropTable(
                name: "actiarea_db");

            migrationBuilder.DropTable(
                name: "activityadmin_db");

            migrationBuilder.DropTable(
                name: "area_db");

            migrationBuilder.DropTable(
                name: "companyadmin_db");

            migrationBuilder.DropTable(
                name: "custadmin_db");

            migrationBuilder.DropTable(
                name: "industryadmin_db");

            migrationBuilder.DropTable(
                name: "ka_db");

            migrationBuilder.DropTable(
                name: "lang_db");

            migrationBuilder.DropTable(
                name: "level_db");

            migrationBuilder.DropTable(
                name: "nat_db");

            migrationBuilder.DropTable(
                name: "posi_db");

            migrationBuilder.DropTable(
                name: "type_db");
        }
    }
}
